package com.ossean.dao;

import com.ossean.model.OpenSourceProject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface OpenSourceProjectsDao {

	@Select("select id,tags from ${table} limit #{start},#{end}")
	public List<OpenSourceProject> getOpenSourceProjectTagsList(@Param("table") String table,@Param("start") int start,@Param("end") int end);
	
	@Select("select id from  ${table}")
	public List<Integer> getOpenSourceProjectList(@Param("table") String table);

	@Select("select id from open_source_projects where relative_memos_num>0")
	public List<Integer> getOpenSourceProjectList4Relation(@Param("table") String table);

	@Select("select id from open_source_projects where tags like concat(concat('%',#{tag}),'%') and id!=#{raw_id}")
	public List<Integer> getOpenSourceProjectList4SameTag(@Param("table") String table,@Param("tag") String tag,@Param("raw_id") int id);



}